#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
#include <string.h>
int main()
{
    int n = 0;
    scanf("%d", &n);
    char a[1010] = { 0 }, b[101][1000] = { 0 };
    int i = 0, j = 0;
    getchar();
    gets(a);
    int l = strlen(a);
    int x = l % n;
    int y = l / n;
    int k = l - 1;
    if (x)
    {
        y++;
    }
    for (j = n - 1; j > x - 1; j--)
    {
        b[j][0] = ' ';
    }
    for (i = 0; i < y; i++)
    {
        for (j = x-1; j >= 0; j--)
        {
            b[j][i] = a[k--];
            if (j == 0)
                x = n;
        }
    }

    for (i = 0; i < x; i++)
    {
        for (j = 0; j < y; j++)
        {
            printf("%c", b[i][j]);
        }
        printf("\n");
    }

    return 0;
}